use std::collections::HashMap;

use crate::api::api::PATHS;


#[flutter_rust_bridge::frb(sync)] // Synchronous mode for simplicity of the demo
pub fn greet(name: String) -> String {
    format!("Hello, {name}!")
}

// 自动生成脚手架命令 flutter_rust_bridge_codegen generate --watch
#[flutter_rust_bridge::frb(init)]
pub fn init_app() {
    // Default utilities - feel free to customize
    flutter_rust_bridge::setup_default_user_utils();

}



#[flutter_rust_bridge::frb(sync)] // Synchronous mode for simplicity of the demo
pub fn add_path(exe_path: String) {
    let mut map: HashMap<String, String> = HashMap::new();
    map.insert(String::from("screen_shot"), exe_path);
    PATHS.set(map)
        .unwrap_or_else(|_| println!("try insert pool cell failure!"));
}